<template>
  <div class="pop">
    <span class="font1">{{label}} = </span>
    <slot />
    <el-button v-if="isBtn" @click="$emit('on-clear', '')" class="btn" type="text">清空</el-button>
    <el-button v-if="isBtn" @click="$emit('on-back', '')" class="btn2" type="text">退格</el-button>
  </div>
</template>

<script>
export default {
  props: {
    label: {
      type: String,
      default: '计算公式'
    },
    isBtn: {
      type: Boolean,
      default: true
    }
  }
}
</script>

<style lang="scss" scoped>
.pop {
  border: 1px solid #CCC;
  padding: 10px;
  border-radius: 4px;
  position: relative;
  min-height: 100px;
  margin-bottom: 12px;
  color: #000;
  font-size: 1.3rem;
  line-height: 1.7rem;
}
.font1 {
  color: #666;
  font-size: 1.1rem;
}
.btn {
  position: absolute;
  right: 10px;
  bottom: 0;
}
.btn2 {
  position: absolute;
  right: 50px;
  bottom: 0;
}
</style>
